<!-- directive:title xianbox6.2 -->
<!-- directive:breadcrumb xianbox6.2 -->
<div class="panel-body">
    <div class='panel panel-default'>
        <div class='panel-heading'> xianbox6.2 </div>
        <div class='panel-body'>
            <article class="docs-content">
                <h3>常用的用来测试广告的辅助代码</h3>
                <script type="text/xianjs" ui-bs>
                    var x = document.createElement("script");
                    x.src = "xxxxxxxx.js";
                    document.body.appendChild( x );
                </script>
                <h3>会计再教育 作弊方法</h3>
                <script type="text/xianjs" ui-bs>
                    setInterval(function(){console.log("ding "+(+new Date));update()},10*60*1e3);
                </script>
                <h3>ng-show 不需要 { { x } }</h3>
                <script type="text/xianjs" ui-bs>
                    "angular.1.4.6.min.js:107 Error: [$parse:lexerr]"
                    "http://errors.angularjs.org/1.4.6/$parse/lexerr?"
                    "p0=Unexpected%20nextharacter%20&p1=s%203-3%20%5B%E5%AA%92%5D&p2=ZJ-%E5%AA%92%E4%BD%93wap"
                    "p0=Unexpected nextharacter &p1=s 3-3 [媒]&p2=ZJ-媒体wap"
                </script>
                <h5>翻译结果：<code>意想不到的 nextharacter (next character?)</code></h5>
                <h6>错误源头</h6>
                <script type="text/xianjs" ui-bs>
                    ng-show="{{row.media_name}}"
                </script>
                <h3>脏数据的处理</h3>
                <script type="text/xianjs" ui-bs>
                    "Error: [$rootScope:inprog]"
                    "http://errors.angularjs.org/1.5.8/$rootScope/inprog?p0=%24apply"
                </script>
                <h6>如果使用以下代码提交变量更改</h6>
                <script type="text/xianjs" ui-bs>
                    $scope.$apply()
                </script>
                <h5>AngularJS报如上错误信息时，代表angular说它已经在处理脏数据了，你别老催他。</h5>
                <h6>实际上是起冲突了，使用如下代码异步提交就ok</h6>
                <script type="text/xianjs" ui-bs>
                    scope.ngModel = parseInt(n);
                    //解决办法
                    scope.$applyAsync();
                </script>
                <hr>
                <h3>REPEAT循环无主键</h3>
                <script type="text/xianjs" ui-bs>
                    "Error: [ngRepeat:dupes]"
                    "?p0=item in obj.domain_list_content.split(',')&p1=string:wap.cmread.com&p2=wap.cmread.com"
                </script>
                <h6>如果使用以下代码循环变量</h6>
                <script type="text/xianjs" ui-bs>
                    ng-repeat="item in obj.domain_list_content.split(',')"
                </script>
                <h5>点击错误链接到Angular官网看详细错误，官网明确给出是因为值重复了：</h5>
                <h6>正常的业务里数组有重复的值是很正常的，数组要硬要搞成唯一的ng-repeat才能遍历就白瞎了，继续往下看，发现官网给了一个解决的方案</h6>
                <script type="text/xianjs" ui-bs>
                    <li ng-repeat="item in items track by $index">{{ item }}</li>
                </script>
            </article>
        </div>
    </div>
</div>
